<!doctype html>
    <html lang="zh-CN" >
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container {
            height: auto;
            background: yellow;
            display: grid;
            /* padding: 20px; */
            /* 控制了最小的宽度大小 */
            /* grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); */
            /* 纵向线 以及线之间的宽度 这样与横向线形成网格 */
            grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
            grid-template-rows: repeat(4,80px);
            gap: 10px;
            justify-content:center;
            align-content: center;
            grid-auto-rows: minmax(40px,100px);
        }
        .item {
            /*width: 100px;*/
            /* height: 80px; */
            border-radius: 5px;
            text-align: center;
            line-height: 80px;
            /* font-size: 16px; */
            background: orange;
            box-shadow:inset 2px 5px 10px rgba(0,0,0,.15);
            color: #fff;

        }
    </style>
</head>
<body>

<div class="container">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
    <div class="item">10</div>
    <div class="item">11</div>
    <div class="item">12</div>
    <div class="item">13</div>
    <div class="item">14</div>
    <div class="item">15</div>
    <div class="item">16</div>
    <div class="item">17</div>
    <div class="item">18</div>
    <div class="item">19</div>
</div>

</body>
</html>